﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Smallerp.Contracts.DataContracts
{
    [DataContract]
    public class OrderInfo_PBDCT
    {
        /// <summary>
        /// 是否所有照片都被放到大板上
        /// 0：全部不在，1：部分在，2：全部在
        /// </summary>
        [DataMember]
        public int IsAllPhotoInBoard { get; set; }

        /// <summary>
        /// 是否含有返单的照片
        /// </summary>
        [DataMember]
        public bool HasRebackOrder { get; set; }
        /// <summary>
        /// 是否含用清柜的照片
        /// </summary>
        [DataMember]
        public bool IsClearBox { get; set; }
        [DataMember]
        public Order_InfoDCT order_Base_Info { get; set; }
        [DataMember]
        public List<PhotoInfo_PBDCT> PhotoList { get; set; }
        
        public OrderInfo_PBDCT()
        {
            PhotoList = new List<PhotoInfo_PBDCT>();
        }
        [DataMember]
        public string OrilOrderPath { get; set; }
        [DataMember]
        public string OrderName { get { return order_Base_Info.OrderName; } set { ; } }
        [DataMember]
        public int ProductNum { get { return order_Base_Info.ProductNum; } set { ; } }
        [DataMember]
        public int Priority { get { return order_Base_Info.Priority; } set { ; } }

        [DataMember]
        public string FatherFolder { get { return order_Base_Info.FatherFolder; } set { ; } }
    
        [DataMember]
        public string GranddadFolder { get { return order_Base_Info.GranddadFolder; } set { ; } }
        /// <summary>
        /// 商户名称,也就是第一个/后面的
        /// </summary>
        [DataMember]
        public string ShopName
        {
            get
            {
                string strR = string.Empty;
                try
                {
                    strR = OrderName.Split(new char[] { '\\' })[1];
                }
                catch (Exception)
                {
                    strR = string.Empty;
                }
                if (string.IsNullOrEmpty(strR))
                {
                    strR = OrderName;
                }

                return strR;
            }
            set { ; }
        }
        /// <summary>
        /// 客户名称，也就是第二个/后面的
        /// </summary>
        [DataMember]
        public string CtmName
        {
            get
            {
                string strR = string.Empty;
                try
                {
                    strR = OrderName.Split(new char[] { '\\' })[2];
                }
                catch (Exception)
                {
                    strR = string.Empty;
                }
                if (string.IsNullOrEmpty(strR))
                {
                    strR = OrderName;
                }

                return strR;
            }
            set { ; }
        }

    }
}
